Optimal. Leaf size=140 \[ -\frac {b g-2 a h+(2 c g-b h) x}{2 \left (b^2-4 a c\right ) d^2 \left (a+b x+c x^2\right )^2}+\frac {3 (2 c g-b h) (b+2 c x)}{2 \left (b^2-4 a c\right )^2 d^2 \left (a+b x+c x^2\right )}-\frac {6 c (2 c g-b h) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{5/2} d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.147, Rules used = {1012, 652, 628,
632, 212} \begin {gather*} \frac {3 (b+2 c x) (2 c g-b h)}{2 d^2 \left (b^2-4 a c\right )^2 \left (a+b x+c x^2\right )}-\frac {-2 a h+x (2 c g-b h)+b g}{2 d^2 \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )^2}-\frac {6 c (2 c g-b h) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{d^2 \left (b^2-4 a c\right )^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 628
Rule 632
Rule 652
Rule 1012
Rubi steps
\begin {align*} \int \frac {g+h x}{\left (a+b x+c x^2\right ) \left (a d+b d x+c d x^2\right )^2} \, dx &=\frac {\int \frac {g+h x}{\left (a+b x+c x^2\right )^3} \, dx}{d^2}\\ &=-\frac {b g-2 a h+(2 c g-b h) x}{2 \left (b^2-4 a c\right ) d^2 \left (a+b x+c x^2\right )^2}-\frac {(3 (2 c g-b h)) \int \frac {1}{\left (a+b x+c x^2\right )^2} \, dx}{2 \left (b^2-4 a c\right ) d^2}\\ &=-\frac {b g-2 a h+(2 c g-b h) x}{2 \left (b^2-4 a c\right ) d^2 \left (a+b x+c x^2\right )^2}+\frac {3 (2 c g-b h) (b+2 c x)}{2 \left (b^2-4 a c\right )^2 d^2 \left (a+b x+c x^2\right )}+\frac {(3 c (2 c g-b h)) \int \frac {1}{a+b x+c x^2} \, dx}{\left (b^2-4 a c\right )^2 d^2}\\ &=-\frac {b g-2 a h+(2 c g-b h) x}{2 \left (b^2-4 a c\right ) d^2 \left (a+b x+c x^2\right )^2}+\frac {3 (2 c g-b h) (b+2 c x)}{2 \left (b^2-4 a c\right )^2 d^2 \left (a+b x+c x^2\right )}-\frac {(6 c (2 c g-b h)) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{\left (b^2-4 a c\right )^2 d^2}\\ &=-\frac {b g-2 a h+(2 c g-b h) x}{2 \left (b^2-4 a c\right ) d^2 \left (a+b x+c x^2\right )^2}+\frac {3 (2 c g-b h) (b+2 c x)}{2 \left (b^2-4 a c\right )^2 d^2 \left (a+b x+c x^2\right )}-\frac {6 c (2 c g-b h) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{5/2} d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.10, size = 131, normalized size = 0.94 \begin {gather*} \frac {\frac {\left (b^2-4 a c\right ) (-b g+2 a h-2 c g x+b h x)}{(a+x (b+c x))^2}+\frac {3 (2 c g-b h) (b+2 c x)}{a+x (b+c x)}-\frac {12 c (-2 c g+b h) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}}{2 \left (b^2-4 a c\right )^2 d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 141, normalized size = 1.01
method | result | size |
default | \(\frac {\frac {b g -2 a h +\left (-b h +2 c g \right ) x}{2 \left (4 a c -b^{2}\right ) \left (c \,x^{2}+b x +a \right )^{2}}+\frac {3 \left (-b h +2 c g \right ) \left (\frac {2 c x +b}{\left (4 a c -b^{2}\right ) \left (c \,x^{2}+b x +a \right )}+\frac {4 c \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (4 a c -b^{2}\right )^{\frac {3}{2}}}\right )}{2 \left (4 a c -b^{2}\right )}}{d^{2}}\) | \(141\) |
risch | \(\frac {-\frac {3 c^{2} \left (b h -2 c g \right ) x^{3}}{16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}}-\frac {9 b c \left (b h -2 c g \right ) x^{2}}{2 \left (16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}\right )}-\frac {\left (5 a b c h -10 a \,c^{2} g +b^{3} h -2 b^{2} c g \right ) x}{16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}}-\frac {8 a^{2} c h +a \,b^{2} h -10 a b c g +b^{3} g}{2 \left (16 a^{2} c^{2}-8 a \,b^{2} c +b^{4}\right )}}{\left (c \,x^{2}+b x +a \right )^{2} d^{2}}-\frac {3 c \ln \left (\left (32 a^{2} c^{3}-16 a \,b^{2} c^{2}+2 b^{4} c \right ) x -\left (-4 a c +b^{2}\right )^{\frac {5}{2}}+16 a^{2} b \,c^{2}-8 a \,b^{3} c +b^{5}\right ) b h}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}} d^{2}}+\frac {6 c^{2} \ln \left (\left (32 a^{2} c^{3}-16 a \,b^{2} c^{2}+2 b^{4} c \right ) x -\left (-4 a c +b^{2}\right )^{\frac {5}{2}}+16 a^{2} b \,c^{2}-8 a \,b^{3} c +b^{5}\right ) g}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}} d^{2}}+\frac {3 c \ln \left (\left (-32 a^{2} c^{3}+16 a \,b^{2} c^{2}-2 b^{4} c \right ) x -\left (-4 a c +b^{2}\right )^{\frac {5}{2}}-16 a^{2} b \,c^{2}+8 a \,b^{3} c -b^{5}\right ) b h}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}} d^{2}}-\frac {6 c^{2} \ln \left (\left (-32 a^{2} c^{3}+16 a \,b^{2} c^{2}-2 b^{4} c \right ) x -\left (-4 a c +b^{2}\right )^{\frac {5}{2}}-16 a^{2} b \,c^{2}+8 a \,b^{3} c -b^{5}\right ) g}{\left (-4 a c +b^{2}\right )^{\frac {5}{2}} d^{2}}\) | \(504\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 565 vs.
\(2 (132) = 264\).
time = 0.53, size = 1150, normalized size = 8.21 \begin {gather*} \left [\frac {6 \, {\left (2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )} g - {\left (b^{3} c^{2} - 4 \, a b c^{3}\right )} h\right )} x^{3} + 9 \, {\left (2 \, {\left (b^{3} c^{2} - 4 \, a b c^{3}\right )} g - {\left (b^{4} c - 4 \, a b^{2} c^{2}\right )} h\right )} x^{2} - 6 \, {\left (2 \, a^{2} c^{2} g - a^{2} b c h + {\left (2 \, c^{4} g - b c^{3} h\right )} x^{4} + 2 \, {\left (2 \, b c^{3} g - b^{2} c^{2} h\right )} x^{3} + {\left (2 \, {\left (b^{2} c^{2} + 2 \, a c^{3}\right )} g - {\left (b^{3} c + 2 \, a b c^{2}\right )} h\right )} x^{2} + 2 \, {\left (2 \, a b c^{2} g - a b^{2} c h\right )} x\right )} \sqrt {b^{2} - 4 \, a c} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) - {\left (b^{5} - 14 \, a b^{3} c + 40 \, a^{2} b c^{2}\right )} g - {\left (a b^{4} + 4 \, a^{2} b^{2} c - 32 \, a^{3} c^{2}\right )} h + 2 \, {\left (2 \, {\left (b^{4} c + a b^{2} c^{2} - 20 \, a^{2} c^{3}\right )} g - {\left (b^{5} + a b^{3} c - 20 \, a^{2} b c^{2}\right )} h\right )} x}{2 \, {\left ({\left (b^{6} c^{2} - 12 \, a b^{4} c^{3} + 48 \, a^{2} b^{2} c^{4} - 64 \, a^{3} c^{5}\right )} d^{2} x^{4} + 2 \, {\left (b^{7} c - 12 \, a b^{5} c^{2} + 48 \, a^{2} b^{3} c^{3} - 64 \, a^{3} b c^{4}\right )} d^{2} x^{3} + {\left (b^{8} - 10 \, a b^{6} c + 24 \, a^{2} b^{4} c^{2} + 32 \, a^{3} b^{2} c^{3} - 128 \, a^{4} c^{4}\right )} d^{2} x^{2} + 2 \, {\left (a b^{7} - 12 \, a^{2} b^{5} c + 48 \, a^{3} b^{3} c^{2} - 64 \, a^{4} b c^{3}\right )} d^{2} x + {\left (a^{2} b^{6} - 12 \, a^{3} b^{4} c + 48 \, a^{4} b^{2} c^{2} - 64 \, a^{5} c^{3}\right )} d^{2}\right )}}, \frac {6 \, {\left (2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )} g - {\left (b^{3} c^{2} - 4 \, a b c^{3}\right )} h\right )} x^{3} + 9 \, {\left (2 \, {\left (b^{3} c^{2} - 4 \, a b c^{3}\right )} g - {\left (b^{4} c - 4 \, a b^{2} c^{2}\right )} h\right )} x^{2} - 12 \, {\left (2 \, a^{2} c^{2} g - a^{2} b c h + {\left (2 \, c^{4} g - b c^{3} h\right )} x^{4} + 2 \, {\left (2 \, b c^{3} g - b^{2} c^{2} h\right )} x^{3} + {\left (2 \, {\left (b^{2} c^{2} + 2 \, a c^{3}\right )} g - {\left (b^{3} c + 2 \, a b c^{2}\right )} h\right )} x^{2} + 2 \, {\left (2 \, a b c^{2} g - a b^{2} c h\right )} x\right )} \sqrt {-b^{2} + 4 \, a c} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) - {\left (b^{5} - 14 \, a b^{3} c + 40 \, a^{2} b c^{2}\right )} g - {\left (a b^{4} + 4 \, a^{2} b^{2} c - 32 \, a^{3} c^{2}\right )} h + 2 \, {\left (2 \, {\left (b^{4} c + a b^{2} c^{2} - 20 \, a^{2} c^{3}\right )} g - {\left (b^{5} + a b^{3} c - 20 \, a^{2} b c^{2}\right )} h\right )} x}{2 \, {\left ({\left (b^{6} c^{2} - 12 \, a b^{4} c^{3} + 48 \, a^{2} b^{2} c^{4} - 64 \, a^{3} c^{5}\right )} d^{2} x^{4} + 2 \, {\left (b^{7} c - 12 \, a b^{5} c^{2} + 48 \, a^{2} b^{3} c^{3} - 64 \, a^{3} b c^{4}\right )} d^{2} x^{3} + {\left (b^{8} - 10 \, a b^{6} c + 24 \, a^{2} b^{4} c^{2} + 32 \, a^{3} b^{2} c^{3} - 128 \, a^{4} c^{4}\right )} d^{2} x^{2} + 2 \, {\left (a b^{7} - 12 \, a^{2} b^{5} c + 48 \, a^{3} b^{3} c^{2} - 64 \, a^{4} b c^{3}\right )} d^{2} x + {\left (a^{2} b^{6} - 12 \, a^{3} b^{4} c + 48 \, a^{4} b^{2} c^{2} - 64 \, a^{5} c^{3}\right )} d^{2}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 709 vs.
\(2 (133) = 266\).
time = 1.21, size = 709, normalized size = 5.06 \begin {gather*} \frac {3 c \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (b h - 2 c g\right ) \log {\left (x + \frac {- 192 a^{3} c^{4} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (b h - 2 c g\right ) + 144 a^{2} b^{2} c^{3} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (b h - 2 c g\right ) - 36 a b^{4} c^{2} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (b h - 2 c g\right ) + 3 b^{6} c \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (b h - 2 c g\right ) + 3 b^{2} c h - 6 b c^{2} g}{6 b c^{2} h - 12 c^{3} g} \right )}}{d^{2}} - \frac {3 c \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (b h - 2 c g\right ) \log {\left (x + \frac {192 a^{3} c^{4} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (b h - 2 c g\right ) - 144 a^{2} b^{2} c^{3} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (b h - 2 c g\right ) + 36 a b^{4} c^{2} \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (b h - 2 c g\right ) - 3 b^{6} c \sqrt {- \frac {1}{\left (4 a c - b^{2}\right )^{5}}} \left (b h - 2 c g\right ) + 3 b^{2} c h - 6 b c^{2} g}{6 b c^{2} h - 12 c^{3} g} \right )}}{d^{2}} + \frac {- 8 a^{2} c h - a b^{2} h + 10 a b c g - b^{3} g + x^{3} \left (- 6 b c^{2} h + 12 c^{3} g\right ) + x^{2} \left (- 9 b^{2} c h + 18 b c^{2} g\right ) + x \left (- 10 a b c h + 20 a c^{2} g - 2 b^{3} h + 4 b^{2} c g\right )}{32 a^{4} c^{2} d^{2} - 16 a^{3} b^{2} c d^{2} + 2 a^{2} b^{4} d^{2} + x^{4} \cdot \left (32 a^{2} c^{4} d^{2} - 16 a b^{2} c^{3} d^{2} + 2 b^{4} c^{2} d^{2}\right ) + x^{3} \cdot \left (64 a^{2} b c^{3} d^{2} - 32 a b^{3} c^{2} d^{2} + 4 b^{5} c d^{2}\right ) + x^{2} \cdot \left (64 a^{3} c^{3} d^{2} - 12 a b^{4} c d^{2} + 2 b^{6} d^{2}\right ) + x \left (64 a^{3} b c^{2} d^{2} - 32 a^{2} b^{3} c d^{2} + 4 a b^{5} d^{2}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.47, size = 219, normalized size = 1.56 \begin {gather*} \frac {6 \, {\left (2 \, c^{2} g - b c h\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{{\left (b^{4} d^{2} - 8 \, a b^{2} c d^{2} + 16 \, a^{2} c^{2} d^{2}\right )} \sqrt {-b^{2} + 4 \, a c}} + \frac {12 \, c^{3} g x^{3} - 6 \, b c^{2} h x^{3} + 18 \, b c^{2} g x^{2} - 9 \, b^{2} c h x^{2} + 4 \, b^{2} c g x + 20 \, a c^{2} g x - 2 \, b^{3} h x - 10 \, a b c h x - b^{3} g + 10 \, a b c g - a b^{2} h - 8 \, a^{2} c h}{2 \, {\left (b^{4} d^{2} - 8 \, a b^{2} c d^{2} + 16 \, a^{2} c^{2} d^{2}\right )} {\left (c x^{2} + b x + a\right )}^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.42, size = 395, normalized size = 2.82 \begin {gather*} \frac {6\,c\,\mathrm {atan}\left (\frac {d^2\,\left (\frac {6\,c^2\,x\,\left (b\,h-2\,c\,g\right )}{d^2\,{\left (4\,a\,c-b^2\right )}^{5/2}}+\frac {3\,c\,\left (b\,h-2\,c\,g\right )\,\left (16\,a^2\,b\,c^2\,d^2-8\,a\,b^3\,c\,d^2+b^5\,d^2\right )}{d^4\,{\left (4\,a\,c-b^2\right )}^{5/2}\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}\right )\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}{6\,c^2\,g-3\,b\,c\,h}\right )\,\left (b\,h-2\,c\,g\right )}{d^2\,{\left (4\,a\,c-b^2\right )}^{5/2}}-\frac {\frac {8\,c\,h\,a^2+h\,a\,b^2-10\,c\,g\,a\,b+g\,b^3}{2\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}+\frac {x\,\left (b^2+5\,a\,c\right )\,\left (b\,h-2\,c\,g\right )}{16\,a^2\,c^2-8\,a\,b^2\,c+b^4}+\frac {3\,c^2\,x^3\,\left (b\,h-2\,c\,g\right )}{16\,a^2\,c^2-8\,a\,b^2\,c+b^4}+\frac {9\,b\,c\,x^2\,\left (b\,h-2\,c\,g\right )}{2\,\left (16\,a^2\,c^2-8\,a\,b^2\,c+b^4\right )}}{x^2\,\left (b^2\,d^2+2\,a\,c\,d^2\right )+a^2\,d^2+c^2\,d^2\,x^4+2\,a\,b\,d^2\,x+2\,b\,c\,d^2\,x^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________